package myWindows;

import java.awt.BorderLayout;

import javax.swing.*;

public class JTestBorderLayout extends JFrame{
    public JTestBorderLayout() {
        this.setTitle("Test BorderLayout");
        this.setSize(400,300);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        //Agragamos un Label en la zona Norte
        JLabel label = new JLabel("Zona Norte", JLabel.CENTER);
        this.getContentPane().add(label, BorderLayout.NORTH);
        
        //Colocar un boton en los laterales
        this.getContentPane().add(new JButton("Este"), BorderLayout.EAST);
        this.getContentPane().add(new JButton("Oeste"), BorderLayout.WEST);
        
        //Colocar un JTextField en la parte inferior
        this.getContentPane().add(new JTextField(), BorderLayout.SOUTH);
        
        //Colocar un JTReView en la zona central
        //this.getContentPane().add(new JTree(), BorderLayout.CENTER);
        JButton myBoton = new JButton("Centro");
        this.getContentPane().add(myBoton, BorderLayout.CENTER);
        
        //Intentar insertar otro control en la zona central
        JButton myBoton2 = new JButton("Boton 2");
        this.getContentPane().add(myBoton2, BorderLayout.CENTER);
        
    }

    public static void main(String[] args) {
        JTestBorderLayout objWindow = new JTestBorderLayout();
        objWindow.setVisible(true);
        
    }
}
